package com.novoda.runbuddy.view;

import java.util.List;

import android.app.Activity;
import android.app.ListActivity;
import android.content.Context;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.google.android.maps.MapView;
import com.novoda.runbuddy.controller.RouteRunnerControllerImpl;
import com.novoda.runbuddy.model.ListOfRuns;
import com.novoda.runbuddy.model.Route;

public class RouteRunnerView {

	private ListActivity	context;
	private RouteRunnerControllerImpl	controller;
	private Button	startPreviousRoute;
	private OnClickListener	executeAPreviousRoute;
	private MapView	mapView;
	private List<Route>	allRoutesAroundCurrentArea;

	public RouteRunnerView(ListActivity routeRunner, RouteRunnerControllerImpl routeRunnerControllerImpl, List<Route> allRoutesAroundCurrentArea, Button startPreviousRoute) {
		this.context = routeRunner;
		this.controller = routeRunnerControllerImpl;
		this.startPreviousRoute = startPreviousRoute;
		this.allRoutesAroundCurrentArea = allRoutesAroundCurrentArea;

		
		listAllRoutes(allRoutesAroundCurrentArea);
		this.startPreviousRoute.setOnClickListener(executeAPreviousRoute);

	}

	private void listAllRoutes(List<Route> allRoutesAroundCurrentArea) {
		context.setListAdapter(new RouteListAdapter(context, allRoutesAroundCurrentArea, this.controller));
	}
		
		
}
